﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestSelectMap.aspx.cs" Inherits="System.Web.Map.TestSelectMap" %>

<%@ Import Namespace="Newtonsoft.Json" %>
<%@ Import Namespace="System.Web.Map" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
        html, body, iframe {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            border: none;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <%
        var data = new SelectMapReqModel()
        {
            //ReturnUrl = "http://www.baidu.com/?type=from",
            ReturnUrl = "saveData",
            //CurUserLocation = new PointModel()
            //{
            //    lat = 22.65222,
            //    lng = 114.1673
            //},
            UserAddress = "罗湖区翠竹路富安娜前人行道",
            MapData = new List<SelectMapItemModel>()
            {
                new SelectMapItemModel()
                {
                    Id = "1",
                    InfoWindowMsg = "罗湖区翠竹路富安娜前人行道",
                    lat = 22.56313,
                    lng = 114.1373
                },
                 new SelectMapItemModel()
                {
                    Id = "2",
                    InfoWindowMsg = "布吉荣超花园外国语学校旁",
                    lat = 22.59888,
                    lng = 114.1258
                },
            }
        };
        reqParamData.Value = JsonConvert.SerializeObject(data);
    %>
    <iframe frameborder="0" name="frame" id="frame"></iframe>
    <form id="form1" runat="server" action="http://mapdev.lizhanglong.com/Map.aspx" target="frame">
        <asp:HiddenField runat="server" ID="reqParamData" />
        <input type="hidden" value="selectMap" name="method" />
    </form>
    <script>
        document.forms[0].submit();
        if (!/^[\d\.\:]+$/.test(location.host)) {
            document.domain = location.host.match(/(\w+\.\w+)(:|$)/)[1];
        }
        function saveData(data) {
            alert('我是父页面中方法');
            alert(JSON.stringify(data));
        }
    </script>
</body>
</html>
